import Vue from 'vue'
import VueRouter from 'vue-router'
import User from '../views/user/User.vue'
import Home from '../views/Home.vue'
import Main from '../views/Main.vue'
import Goods from '../views/goods/Goods.vue'
import Group from '../views/goods/Group.vue'
import Auther from '../views/user/Auther.vue'
import Login from '../views/login/Login.vue'
import Register from '../views/login/Register.vue'
import Myhome from '../views/myhome/Myhome.vue'
import Register2 from '../views/login/Register2.vue'
import Publish from '../views/publish/Publish.vue'
import HomeAdmin from '../views/HomeAdmin.vue'
import HomeShe from '../views/HomeShe.vue'
Vue.use(VueRouter)

const routes = [
  
  {
    path: '/',
    component: Main,
    redirect: '/home', //重定向
    children: [
     
      {path: 'home',   name:'home',   component: Home},
      {path: 'articles',  name:'articles',   component: Goods},
      // {path: 'comments',  name:'comments',   component: Group},
      // {path: 'replys', name:'replys',   component: Auther},
       //发布文章
      { path:'/publish',component:Publish, name:'publish' }
    ]
    
  },
  {
    path: '/',
    component: Main,
    redirect: '/homeadmin', //重定向
    children: [
      {path: 'user',   name:'user',   component: User},
      {path: 'homeadmin',   name:'homeadmin',   component: HomeAdmin},
      {path: 'articles',  name:'articles',   component: Goods},
      {path: 'comments',  name:'comments',   component: Group},
      {path: 'replys', name:'replys',   component: Auther},
      //  //发布文章
      // { path:'/publish',component:Publish, name:'publish' }
    ]
    
  },
  {
    path: '/',
    component: Main,
    redirect: '/homeshe', //重定向
    children: [
      {path: 'user',   name:'user',   component: User},
      {path: 'homeshe',   name:'homeshe',   component: HomeShe},
      {path: 'articles',  name:'articles',   component: Goods},
      {path: 'comments',  name:'comments',   component: Group},
      {path: 'replys', name:'replys',   component: Auther},
      //  //发布文章
      // { path:'/publish',component:Publish, name:'publish' }
    ]
    
  },
  
  // //管理员首页
  // {path: '/homeadmin',component:HomeAdmin,name:'homeadmin'},
  // //审核员首页
  // {path: '/homeshe',component:HomeShe,name:'homeshe'},

  //登录
  {  path: '/login',component:Login,name:'login'},
  //注册
  { path: '/register', component:Register, name:'register'},
  {path: '/register2',component:Register2,name:'register2'},
  //我的主页
  { path:'/myhome',component:Myhome, name:'myhome'},
 
   
  
]

const router = new VueRouter({
  routes
})

export default router
